package com.group4.travel.common;

/**
 * @author : sean
 * @version V1.0
 * @Project: Homework_day16
 * @Package com.sean.common
 * @date Date : 2021年08月04日 21:21
 * @Description: TODO
 */

public class ResponseResult {

    private Integer code;
    private String message;
    private Object data;

    public ResponseResult(Integer code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public ResponseResult(String message, Object data) {
        this.message = message;
        this.data = data;
    }

    public ResponseResult(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public ResponseResult success(Integer code, String message, Object data)
    {
        return new ResponseResult(code,message,data);
    }
    public ResponseResult success(String message, Object data)
    {
        return new ResponseResult(ResponseCode.SUCCESS.getCode(),message,data);
    }
    public ResponseResult success()
    {
        return new ResponseResult(ResponseCode.SUCCESS.getCode(),ResponseCode.SUCCESS.getDesc());
    }

    public ResponseResult error()
    {
        return  new ResponseResult(ResponseCode.ERROR.getCode(),ResponseCode.ERROR.getDesc());
    }
    public ResponseResult error(Integer code, String message, Object data)
    {
        return  new ResponseResult(code,message,data);
    }
    public ResponseResult error(String message, Object data)
    {
        return  new ResponseResult(ResponseCode.ERROR.getCode(),message,data);
    }
}
